package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.AppRegsterPay;

@Mapper
public interface AppRegsterPayDao {

    @Select("select * from app_regster_pay t where t.id = #{id}")
    AppRegsterPay getById(Long id);

    @Delete("delete from app_regster_pay where id = #{id}")
    int delete(Long id);

    int update(AppRegsterPay appRegsterPay);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into app_regster_pay(fid, regsterappid, regsterpayid, hisregno, orderno, orderdate, totalfee, registerdate, ampm, doctorcode, doctorname, deptcode, deptname, deptcode1, deptname1, cardno, cardtype, regdate, reghour, sign, cert, getpersoninfo, trade, divide, feetype, registerstatus, feestatus, clinicroom, receiptsn, checkopercode, checkopername, checktime, paiduino, dangqianno, patientname, patientphone, patientsocial, patientid, times, hostcode, recordsequence) values(#{fid}, #{regsterappid}, #{regsterpayid}, #{hisregno}, #{orderno}, #{orderdate}, #{totalfee}, #{registerdate}, #{ampm}, #{doctorcode}, #{doctorname}, #{deptcode}, #{deptname}, #{deptcode1}, #{deptname1}, #{cardno}, #{cardtype}, #{regdate}, #{reghour}, #{sign}, #{cert}, #{getpersoninfo}, #{trade}, #{divide}, #{feetype}, #{registerstatus}, #{feestatus}, #{clinicroom}, #{receiptsn}, #{checkopercode}, #{checkopername}, #{checktime}, #{paiduino}, #{dangqianno}, #{patientname}, #{patientphone}, #{patientsocial}, #{patientid}, #{times}, #{hostcode}, #{recordsequence})")
    int save(AppRegsterPay appRegsterPay);
    
    int count(@Param("params") Map<String, Object> params);

    List<AppRegsterPay> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
